const proxy = require("http-proxy-middleware");

module.exports = function(app) {
  if (process.env.NODE_ENV === "development") {
    app.use(
      proxy("/open", {
        target: "http://tg.baisha.work/open",
        pathRewrite: { "^/open": "/" },
        changeOrigin: true
      })
    );
    app.use(
      proxy("/back", {
        target: "http://tg.baisha.work/back",
        pathRewrite: { "^/back": "/" },
        changeOrigin: true
      })
    );
  }
};
